package com.example.goodpet.service;

import com.example.goodpet.bean.Follow;
import com.example.goodpet.db.entity.GoodpetHistory;
import com.example.goodpet.bean.LoginData;
import com.example.goodpet.bean.PetCollect;
import com.example.goodpet.bean.PetInformation;
import com.example.goodpet.bean.User;
import com.example.goodpet.bean.UserPetInfo;
import com.example.goodpet.bean.UserPetInfoAndHistory;
import com.example.goodpet.utils.AppNetConfig;

import java.util.List;

import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

public interface UserService {
    //获取单个用户
    @POST(AppNetConfig.GET_USER_BY_PHONE)
    Call<com.example.goodpet.bean.ResponseBody<com.example.goodpet.db.entity.User>> getUserByPhone(@Query("phone") String phone);
    //登录
    @POST(AppNetConfig.LOGIN)
    public Call<LoginData> login(@Query("phoneNumber") String phoneNumber, @Query("password") String password);
    //注册
    @POST(AppNetConfig.REGISTER)
    Call<com.example.goodpet.bean.ResponseBody<String>> register(@Query("phoneNumber") String phoneNumber, @Query("password") String password);
    //更改头像
    @POST(AppNetConfig.PORTRAIT_CHANGE)
    public Call<ResponseBody> portraitChange(@Query(("portrait")) String portrait,@Query("id") long id);
    //更改个人信息
    @POST(AppNetConfig.UPDATE_USER_INFORMATION)
    public Call<ResponseBody> updateUserInformation(@Query("id") long id,@Query("gender") int gender,@Query(("nickname")) String nickname,@Query(("signature")) String signature);
    //获取我发布的信息
    @POST(AppNetConfig.GET_MY_RELEASE)
    public Call<com.example.goodpet.bean.ResponseBody<List<PetInformation>>> getMyRelease(@Query("id") long id,@Query("page") int page);
    /*//获取用户发布的信息
    @POST(AppNetConfig.GET_USER_RELEASE)
    Call<com.example.goodpet.bean.ResponseBody<List<UserPetInfo>>> getUserRelease(@Query("id") int id,@Query("page") int page)*/
    //发送宠物收藏
    @POST(AppNetConfig.PET_COLLECT)
    Call<com.example.goodpet.bean.ResponseBody<String>> petCollect(@Body PetCollect petCollect);
    //获取宠物收藏信息
    @POST(AppNetConfig.GET_PET_COLLECTION)
    Call<com.example.goodpet.bean.ResponseBody<List<UserPetInfo>>> getPetCollection(@Query("id") long userId,@Query("page") int page);
    //删除宠物收藏信息
    @POST(AppNetConfig.DELETE_PET_COLLECT)
    Call<com.example.goodpet.bean.ResponseBody<String>> deletePetCollect(@Query("userId") long userId,@Query("petId") long petId);
    //判断是否收藏宠物信息
    @POST(AppNetConfig.IS_PET_COLLECT)
    Call<com.example.goodpet.bean.ResponseBody<Object>> isPetCollect(@Query("userId") long userId,@Query("petId") long petId);
    //记录宠物信息历史浏览
    @POST(AppNetConfig.RECORD_GOODPET_HISTORY)
    Call<com.example.goodpet.bean.ResponseBody<String>> recordGoodpetHistory(@Body GoodpetHistory goodpetHistory);
    //获取宠物信息历史浏览
    @POST(AppNetConfig.GET_PET_HISTORY)
    Call<com.example.goodpet.bean.ResponseBody<List<UserPetInfoAndHistory>>> getPetHistory(@Body List<GoodpetHistory> goodpetHistories);
    //清空宠物信息历史浏览
    @POST(AppNetConfig.CLEAR_PET_HISTORY)
    Call<com.example.goodpet.bean.ResponseBody<String>> clearPetHistory(@Query("id") long id);

    //初始化userInfoActivity，例如获取关注数量，粉丝数量，是否关注信息
    @POST(AppNetConfig.INIT_USERINFO_ACTIVITY)
    Call<ResponseBody> initUserInfoActivity(@Query("myId") long myId,@Query("userId") long userId);

    //获取我的关注
    @POST(AppNetConfig.GET_MY_FOLLOW)
    Call<com.example.goodpet.bean.ResponseBody<List<User>>> getMyFollow(@Query("userId") long userId, @Query("page") int page);
    //获取我的粉丝
    @POST(AppNetConfig.GET_MY_FENSI)
    Call<com.example.goodpet.bean.ResponseBody<List<User>>> getMyFensi(@Query("userId") long userId, @Query("page") int page);

    //关注某人请求
    @POST(AppNetConfig.FOLLOW_SOMEONE)
    Call<com.example.goodpet.bean.ResponseBody<Object>> followSomeone(@Body Follow follow);
    //取消关注某人请求
    @POST(AppNetConfig.UNFOLLOW_SOMEONE)
    Call<com.example.goodpet.bean.ResponseBody<Object>> unFollowSomeone(@Body Follow follow);

    //获取我的关注的近期更新
    @POST(AppNetConfig.GET_MY_FOLLOW_UPDATE)
    Call<com.example.goodpet.bean.ResponseBody<List<UserPetInfo>>> getMyFollowUpdate(@Query("userId") long userId, @Query("page") int page);

    //根据nickname模糊查询user
    @POST(AppNetConfig.GET_USER_BY_NICKNAME)
    Call<com.example.goodpet.bean.ResponseBody<List<com.example.goodpet.db.entity.User>>> getUserByNickname(@Query("nickname") String nickname, @Query("page") int page);

    //上传崩溃文件
    @Multipart
    @POST(AppNetConfig.UPLOAD_FILE)
    Call<com.example.goodpet.bean.ResponseBody<String>> uploadFile(@Part MultipartBody.Part file,@Query("filename") String filename);
}

